.NET Framework Class Library |
Lazy<(Of <(T>)>) Constructor (Func<(Of <(T>)>)) |
Lazy<(Of <(T>)>) Class See Also Send Feedback |
Initializes a new instance of the Lazy<(Of <(T>)>) class that uses a
specified initialization function.
Namespace:
System
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub New ( _ valueFactory As Func(Of T) _ ) |
C# |
---|
public Lazy( Func<T> valueFactory ) |
Parameters
- valueFactory
- Type: System..::.Func<(Of <(T>)>)
The Func<(Of <(T>)>) invoked to produce the lazily-initialized value when it is needed.
Remarks
An instance created with this constructor may be used concurrently from multiple threads.
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | valueFactory is a null reference (Nothing in Visual Basic). |